<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Order_no')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{$row.order_no|htmlentities}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Trade_no')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{$row.trade_no|htmlentities}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('下单用户')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{$row.user.nickname|htmlentities}</label>
        </div>
    </div>
    {php}
        $goods=\app\admin\model\ShopOrderItem::where(['order_id'=>$row['id']])->select();
    {/php}

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('订单商品')}:</label>
        <div class="col-xs-12 col-sm-8">
            <ul class="row list-inline faupload-preview" id="p-avatar">
                {foreach $goods as $k => $v}
                <li class="col-xs-3">
                    <a href="{$v.goods_image}" data-url="{$v.goods_image}" target="_blank" class="thumbnail">
                        <img src="{$v.goods_image}" onerror="this.src='/xtGwSBDCQl.php/ajax/icon?suffix=jpg';this.onerror=null;" class="img-responsive">
                    </a>
                    <a href="javascript:;" class="btn btn-danger btn-xs">
                        {$v.goods_name}
                    </a>
                    <a href="javascript:;" class="btn btn-danger btn-xs">
                        {$v.goods_price} * {$v.goods_number}
                    </a>
                </li>
                {/foreach}
            </ul>
        </div>
    </div>

    {php}
    $province = \app\admin\model\Area::where(['id'=>$row['address']['province_id']])
    ->value('name');
    $city = \app\admin\model\Area::where(['id'=>$row['address']['city_id']])
    ->value('name');
    $area = \app\admin\model\Area::where(['id'=>$row['address']['area_id']])
    ->value('name');
    $row['region'] = $province.'/'.$city.'/'.$area;
    {/php}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('收货地址')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">收货人：{$row.address.name|htmlentities}</label><br>
            <label class="control-label">联系电话：{$row.address.mobile|htmlentities}</label><br>
            <label class="control-label">收货地址：{$row.region|htmlentities}{$row.address.address|htmlentities}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Used_score')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{$row.used_score|htmlentities}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Score_money')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{$row.score_money|htmlentities}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Coupon_money')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{$row.coupon_money|htmlentities}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Amount')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{$row.amount|htmlentities}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Payamount')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{$row.payamount|htmlentities}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('支付状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{if $row.paid == 1}已支付{else/}未支付{/if}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Paytime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="control-label">{:$row.paytime?datetime($row.paytime):''}</label>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Memo')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-memo" class="form-control" name="row[memo]" rows="5">{$row.memo|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('物流公司')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-logistic" min="0" class="form-control" name="row[logistic]" type="text" value="{$row.logistic|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('物流单号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-logistic_no" min="0" class="form-control" name="row[logistic_no]" type="text" value="{$row.logistic_no|htmlentities}">
        </div>
    </div>

    {if $row.status == 0}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:Form::radios('row[status]', ['1'=>'待收货'], 1, ['data-rule'=>'required'])}
        </div>
    </div>
    {/if}

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
